<?php 
header('Content-Type:text/html;charset=gbk');
require_once("db_manage.php");
//require_once 'bbs/include/common.inc.php';
$title = $_POST['title'];
$area = $_POST['area'];
$view = $_POST['view'];
$bed = $_POST['bed'];
$type = $_POST['type'];
$traffic = $_POST['traffic'];
$expense = $_POST['expense'];
$num = $_POST['num'];
$costdate = $_POST['costdate'];
$backdate = $_POST['backdate'];
$content = $_POST['content'];
$edit = $_POST['edit'];
$back = $_GET['back'];
///////////////////////
$module = $_POST['module'];
$fid = $_POST['travelid'];
$routeid = $_POST['routeid'];
$uid = $_POST['postuser'];
$content = $_POST['content'];
$travel_title = $_POST['travel_title'];
$travel_info = $_POST['travel_info'];
$travel_id = $_POST['travel_id'];
$scence_id = $_POST['scence_id'];
$area_info = $_POST['area_info'];
$playid = $_POST['playid'];
$fid = $_POST['fid'];

if($module=="travel"){
	$comment = array(addslashes($fid),addslashes($content),addslashes($uid),"travel");
	addComment($comment);
	echo "<script>location.href='travel_detail.php?id=".$fid."';</script>";  
}else if($module=="scence"){
	$comment = array(addslashes($fid),addslashes($content),addslashes($uid),"scence");
	addComment($comment);
	echo "<script>location.href='scence_detail.php?id=".$fid."&travelid=".$travel_id."&traveltitle=".$travel_title."&area_info=".$area_info."';</script>"; 	
}else if($module=="route"){	
	$sql = "insert into pcd_comment (fid,comment,postuser,state,postdate,timestamp,module) values('".addslashes($fid)."','".addslashes($content)."','".addslashes($uid)."',0,now(),now(),'route')";
	mysql_query($sql);
	echo "<script>location.href='route_detail.php?id=".$fid."';</script>";  
}else if($module=="play"){
	$sql = "insert into pcd_comment (fid,comment,postuser,state,postdate,timestamp,module) values('".addslashes($fid)."','".addslashes($content)."','".addslashes($uid)."',0,now(),now(),'play')";
	mysql_query($sql);
	echo "<script>location.href='play_detail.php?id=".$playid."';</script>";  
}else if($module=="news"){
	$sql = "insert into pcd_comment (fid,comment,postuser,state,postdate,timestamp,module) values('".addslashes($fid)."','".addslashes($content)."','".addslashes($uid)."',0,now(),now(),'".$module."')";
	mysql_query($sql);
	echo "<script>location.href='news_detail.php?id=".$fid."';</script>";
}
?>